package com.dmwork.service.interaction.controller.front.feign;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dmwork.common.base.result.R;
import com.dmwork.service.interaction.entity.Feed;
import com.dmwork.service.interaction.service.FeedService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/front/dm_work/interaction/feed/feign")
public class FrontFeignFeedController {

    @Autowired
    private FeedService feedService;

    /**
     * 获取指定用户的动态数
     * @param customerId
     * @return
     */
    @GetMapping("get_feed_count/{customerId}")
    public R getFeedCount(@PathVariable String customerId) {
        int count = feedService.count(new QueryWrapper<Feed>().eq("customer_id", customerId));
        return R.ok().data("count", count);
    }
}
